class EditsController < ApplicationController
  filter_access_to :all

  def index 
   #Find the item in question, based on which parameters
   # come in
   if params[:artist_id]
     @item = Artist.find(params[:artist_id])
   elsif params[:release_id]
     @item = Edition.find(params[:release_id])
     @release = @item.release
   elsif params[:genre_id]
     @item = Genre.find(params[:genre_id])
   elsif params[:label_id]
     @item = Label.find(params[:label_id])
   elsif params[:song_id]
     @item = Song.find(params[:song_id])
   end

   #Makes all of the edits accessable
   @edits = @item.edits

   #If a release/edition, lumps the edition and
   # release edits together
   if params[:release_id]
     @edits << @release.edits
   end

  end

end
